<!DOCTYPE html>
<html>
<head lang="en">
	<meta charset="UTF-8">
<title>图片轮换</title>
	<link rel="stylesheet" href="css/scroll.css">
	<script type="text/javascript">
		function lunbo(lun){
		var a=document.getElementById("photo");
			if(lun.name=="name1"){
				a.setAttribute("src","images/1.gif");
			}else if(lun.name=="name2"){
				a.setAttribute("src","images/2.gif");
			}else if(lun.name=="name3"){
				a.setAttribute("src","images/3.jpg");
			}else if(lun.name=="name4"){
				a.setAttribute("src","images/4.jpg");
			}else{
				a.setAttribute("src","images/5.gif");
			}
		}
		
		
	</script>
</head>

<body>
<div class="scroll">
	<div id="num">
		<a href="#" onclick="lunbo(this)" name="name1" >1</a>
		<a href="#" onclick="lunbo(this)"  name="name2">2</a>
		<a href="#" onclick="lunbo(this)"  name="name3">3</a>
		<a href="#" onclick="lunbo(this)"  name="name4">4</a>
		<a href="#" onclick="lunbo(this)"  name="name5">5</a>
	</div>
	<img src="images/1.gif" alt="图片" id="photo" />
</div>
</body>
</html>
